package 公司真题.携程;

import java.util.Scanner;

public class _循环输出数组 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int arrLen = Integer.parseInt(sc.nextLine());
        String shuzu = sc.nextLine();
        int beginIndex = Integer.parseInt(sc.nextLine());
        int outputCount = Integer.parseInt(sc.nextLine());
        String[] strArr = shuzu.trim().split(" ");
        int[] arr = new int[arrLen];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = Integer.parseInt(strArr[i]);
        }
        boolean fangxiang = true;
        // fangxiang为true则从左至右，false则从右至左
        while (outputCount > 0) {
            if (fangxiang) {
                System.out.println(arr[beginIndex]);
                beginIndex++;
                if (beginIndex >= arrLen) {
                    fangxiang = false;
                    beginIndex -= 2;
                }
            } else {
                System.out.println(arr[beginIndex]);
                beginIndex--;
                if (beginIndex < 0) {
                    fangxiang = true;
                    beginIndex += 2;
                }
            }
            outputCount--;
        }
    }
}
